# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=musl-locales
pkgver=0_git20200319
pkgrel=1
_commit="c48b979a4ed2a133e2838753bb8f567c3e0da5a1"
arch="all"
url="https://gitlab.com/rilian-la-te/musl-locales"
pkgdesc="Locales support for musl"
license="LGPL-3.0-only"
options="!check" # No test suite
makedepends="cmake gettext-tiny-dev"
subpackages="$pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/api/v4/projects/rilian-la-te%2Fmusl-locales/repository/archive?sha=$_commit
	add-all-available-locales.patch"
builddir="$srcdir/$pkgname-$_commit-$_commit"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		"$CMAKE_CROSSOPTS"
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

lang() {
	default_lang
	license="MIT"
}

sha512sums="e711b42b5d6137aae1d3de0d8183b2c7496189f20f74fd29c7d3860516b4fc5de7144bf49fae8b241baaa1787e1349318ea1bf245f3c5c8202e2b4441bb03ab2  musl-locales-0_git20200319.tar.gz
dac294f9e6207686b8dcbedfc71db4e7e8c648ca6e11992dd6b606e0fcefc44d15db192753f8a6c902941a5aa9540e54fac2747bfa59058b087c46c49ac314de  add-all-available-locales.patch"
